Skip to content

feat(cursor): add native PowerShell hooks on Windows#617

Closed
MfDevNet wants to merge 1 commit into
tirth8205:mainfrom
MfDevNet:feature/windows-powershell-hooks
Closed

feat(cursor): add native PowerShell hooks on Windows#617
MfDevNet wants to merge 1 commit into
tirth8205:mainfrom
MfDevNet:feature/windows-powershell-hooks

Conversation

@MfDevNet

Copy link
Copy Markdown

Detect the host OS during Cursor hook installation and generate .ps1 scripts with PowerShell-native JSON output on Windows, while keeping the existing Bash hooks unchanged on Linux and macOS. hooks.json now invokes PowerShell with -ExecutionPolicy Bypass on Windows.

Pull Request

Linked issue

Closes #

What & why

How it was tested

uv run pytest tests/ --tb=short -q
uv run ruff check code_review_graph/
uv run mypy code_review_graph/ --ignore-missing-imports --no-strict-optional

Checklist

  • Tests added for new functionality
  • All tests pass: uv run pytest tests/ --tb=short -q
  • Linting passes: uv run ruff check code_review_graph/
  • Type checking passes: uv run mypy code_review_graph/ --ignore-missing-imports --no-strict-optional
  • Lines are at most 100 characters
  • Docs updated where behavior changed (README, docs/, docstrings)

Detect the host OS during Cursor hook installation and generate .ps1 scripts with PowerShell-native JSON output on Windows, while keeping the existing Bash hooks unchanged on Linux and macOS. hooks.json now invokes PowerShell with -ExecutionPolicy Bypass on Windows.
@tirth8205

Copy link
Copy Markdown
Owner

Thanks — native PowerShell wrappers are the right direction for Cursor on Windows, but head b227de1 needs changes before review can pass:

  • Quote the powershell -File path and test a home path containing spaces.
  • Migrate existing CRG .sh hook entries to .ps1 instead of appending duplicates, while preserving unrelated user hooks.
  • Execute the generated scripts on windows-latest, covering large stdin, missing/non-zero code-review-graph, valid JSON output, and exit code 0.
  • Confirm the result in an actual Cursor Windows session.
  • Replace the blank Closes # line with a real issue or state that none exists, and complete the test/docs sections.

Please update this existing PR when those are ready. This is Cursor-specific and is not superseded by the separate Codex hook work in #626.

@tirth8205

Copy link
Copy Markdown
Owner

Thanks again, MfDevNet. Final disposition: the maintained replacement, draft PR #651, carries the native PowerShell Cursor-hook intent and credits your contribution. Its current head is 02eb8d9.

This source is not being merged directly because the PowerShell -File path is unquoted, reinstalling appends Windows entries beside stale Unix CRG entries, and validation only asserts strings rather than executing the generated hooks on Windows. PR #651 fixes those gaps and has green automated Windows coverage, but remains a draft pending confirmation in a real released Cursor Windows session after upgrading an existing Unix-only configuration.

Closing only this source PR as superseded; PR #651 remains open for that validation.

@tirth8205 tirth8205 closed this Jul 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants